<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>蔡BB论坛首页</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }

        header {
            background-color: #f1f1f1;
            padding: 20px;
            text-align: center;
        }

        nav {
            display: flex;
            justify-content: space-around;
            background-color: #333;
        }

        nav a {
            color: white;
            text-decoration: none;
            padding: 14px 20px;
        }

        nav a:hover {
            background-color: #ddd;
            color: black;
        }

        section {
            display: flex;
            justify-content: space-around;
            padding: 20px;
        }

        footer {
            background-color: #f1f1f1;
            padding: 20px;
            text-align: center;
        }

        .logged-in-indicator {
            position: absolute;
            top: 10px; /* 根据header的padding调整 */
            right: 20px; /* 根据需要调整位置 */
            color: #fff;
            background-color: #4CAF50; /* 绿色背景 */
            padding: 5px 10px;
            border-radius: 5px;
            font-size: 14px;
        }
          #username_state{
            font-size: 30px;
            color: black;
            font-family: Arial, sans-serif;
        }
    </style>
</head>
<body>
<header>
    <h1>欢迎来到蔡BB论坛</h1>
    {% if session.get("username") %}
        <div class="logged-in-indicator">用户：<span id="username_state">{{session.get("username")}}</span>，已登录</div>
    {% endif %}

</header>
<nav>
    <a href="#">首页</a>
    <a href="#">版块</a>
    <a href="#">发布帖子</a>
    <a href="login.html">登录</a>
    <a href="register.html">注册</a>
    <a href="about.html">关于我们</a>
</nav>
<section>
    <div>
        <h2>热门帖子</h2>
        <ul>
            <li><a href="#">帖子标题1</a></li>
            <li><a href="#">帖子标题2</a></li>
            <li><a href="#">帖子标题3</a></li>
        </ul>
    </div>
    <div>
        <h2>最新帖子</h2>
        <ul>
            <li><a href="#">帖子标题4</a></li>
            <li><a href="#">帖子标题5</a></li>
            <li><a href="#">帖子标题6</a></li>
        </ul>
    </div>
</section>
<footer>
    <p>版权所有 &copy; 2022 BBS论坛</p>
</footer>
</body>
</html>
